package hrc.tool.xml;

import java.io.StringReader;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.xml.sax.InputSource;
/**
 * 
 * @author hrc
 * @see XmlTeller
 */
class OldStringXmlTeller extends XmlTeller{
	OldStringXmlTeller(String xml) throws XmlException{
		try {
            StringReader sr = new StringReader(xml);
            InputSource is = new InputSource(sr);
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            m_doc = builder.parse(is);
        } catch (Exception e) {
            throw new XmlException("fail to read xml string");
        }
	}
	
	@Override
	public void save()throws XmlException{
		//do nothing 
	}
}
